<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <h:head>
        <title>IGNORED</title>
        <h:messages errorClass="errors" layout="list" showDetail="true" showSummary="false"/>
    </h:head>
    <h:body>
        <ui:composition template="/WEB-INF/Templates/Template.xhtml">
            <ui:define name="content">
                <h3 align="center">#{tekster.Overskrift2}</h3>
                <h:form>
                    <div align="center">
                        <h:panelGrid columns="3" border="0">
                            <h:column>
                                #{tekster.navnpaalop}
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.lopet.lopnavn}" required="true" id="lopNavn" requiredMessage="#{tekster.req_navnpaalop}"></h:inputText>
                            </h:column>
                            <h:column>
                                <h:message for="lopNavn" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                #{tekster.Dato}
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.lopet.date}" converter="#{dato}" required="true" id="lopDato" requiredMessage="#{tekster.req_dato}" converterMessage="#{tekster.req_dato}" validatorMessage="#{tekster.req_dato}"/><!--Han blir sur!!--> 
                            </h:column>
                            <h:column>
                                <h:message for="lopDato" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                #{tekster.distanse}
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.lopet.distanse}" required="true" id="lopDistanse" validatorMessage="#{tekster.val_distanse}" converterMessage="#{tekster.val_distanse}" requiredMessage="#{tekster.req_distanse}">
                                    <f:validateDoubleRange for="lopDistanse" minimum="0.01" maximum="1000.0"/>
                                    <f:convertNumber pattern="0.00"/>
                                </h:inputText>
                            </h:column>
                            <h:column>
                                <h:message for="lopDistanse" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                #{tekster.beskrivelse}
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.lopet.beskrivelse}" required="true" id="lopBeskrivelse" requiredMessage="#{tekster.req_beskrivelse}"/>
                            </h:column>
                            <h:column>
                                <h:message for="lopBeskrivelse" errorClass="errors"/>
                            </h:column>  
                            <h:column>
                                <h:commandButton value="#{tekster.Tilbake}" action="/index?faces-redirect=true" immediate="true"/>
                            </h:column>
                            <h:column>
                                <h:commandButton value="#{tekster.Send}" action="#{rb.regLop()}"/> 
                            </h:column>                                    
                        </h:panelGrid>
                    </div>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
